package com.szrt.table2entity;

import java.io.IOException;
import java.util.Properties;


import com.szrt.base.EntityUtil;

/**
 * 读取数据库表生成实体类
 * @author My
 *
 */
public class Generate {
	
	public static void main(String[] args) throws Exception {
		
		Properties properties=new Properties();
		try {
			//用线程的方法加载配置文件，获得xmlPath，generatePath
			properties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream("tables2Entity.properties"));
		} catch (IOException e) {
			e.printStackTrace();
		}
		
		//xml文件的路径
		String xmlPash = properties.getProperty("xmlPath");
		
		//生成实体类的路径
		String generatePath=properties.getProperty("generatePath");
		
		//生成实体类
		EntityUtil.table2Entity(xmlPash, generatePath);
	}
	
	
	
	
	
}
